/*
 * @Author: lwHao
 * @Date: 2020-07-18 17:45:51
 * @LastEditors: lwHao
 * @LastEditTime: 2020-07-19 00:09:51
 */ 
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack')

module.exports = {
  mode: 'none',
  entry: './src/main.js',
  output:{
    filename: '[name]-[hash].bundle.js',
    path: path.join(__dirname, 'dist'),
  },
  module:{
    rules: [
      {
        test: /\.css$/,
        loader:  [
          'vue-style-loader',
          'css-loader',
        ],
      },
      {
        test: /\.less$/,
        loader:  [
          'vue-style-loader',
          'css-loader',
          'less-loader',
        ],
      },
      {
        test: /\.vue$/,
        loader: 'vue-loader',
      },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
      },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'eslint-loader',
        enforce: 'pre'
      },
      {
        test: /\.(png|jpg|gif)$/,
        use: 'file-loader?esModule=false'
      }
    ],
  },
  plugins:[
    new VueLoaderPlugin(),
    new HtmlWebpackPlugin({
      title: 'Vue app base',
    }),
  ]
}